// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'babel-polyfill'
import './config/rem'
import Vue from 'vue'
import App from './App'
import axios from 'axios'
import router from './router'
import fastclick from 'fastclick'
import storage from 'store'
import api from './api'
import { store } from './store'



fastclick.attach(document.body);

import { Tab, Tabs } from 'vant';
Vue.use(Tab).use(Tabs);

import { Swipe, SwipeItem } from 'vant';
Vue.use(Swipe).use(SwipeItem);

import { Tabbar, TabbarItem } from 'vant';
Vue.use(Tabbar).use(TabbarItem);

import { Search } from 'vant';
Vue.use(Search);

import { NumberKeyboard } from 'vant';
Vue.use(NumberKeyboard);

import { Toast } from 'vant';
Vue.use(Toast);

import { Switch } from 'vant';
Vue.use(Switch);

import { Slider } from 'vant';
Vue.use(Slider);

//放入原型
Vue.prototype.$storage = storage;
Vue.prototype.$http = axios;
Vue.prototype.$api = api;


Vue.config.productionTip = false;
axios.defaults.withCredentials = true;


import Router from 'vue-router'
const routerPush = Router.prototype.push;
Router.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error=> error)
};


/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
});
